import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import CLIPSJNI.Environment;

public class Main {

	private static Environment clips;

	private static Map world;

	private static boolean printKnowledge;

	private static boolean printWorld;

	private static boolean manual;

	private static int maxTurns;

	private static TurnHandler handler;

	private static boolean printAction;
	
	private static int waitTime;

	public static void main(String[] args) {
		Main.configureEnvironment();
		setHandler(new TurnHandler(getMap(), Main.isPrintWorld(),
				true));
		getHandler().handle();
	}

	private static void configureEnvironment() {

		setWaitTime(0);
		setPrintAction(true);

		setPrintKnowledge(true);
		setPrintWorld(true);
		setClips(new Environment());
		getClips().load("general.clp");
		getClips().load("rules.clp");
		setWorld(new Map());
	}

	public static Environment getClips() {
		return clips;
	}

	private static void setClips(Environment clips) {
		Main.clips = clips;
	}

	public static Map getMap() {
		return world;
	}

	public static void setWorld(Map world) {
		Main.world = world;
	}

	public static boolean isPrintKnowledge() {
		return printKnowledge;
	}

	public static void setPrintKnowledge(boolean printKnowledge) {
		Main.printKnowledge = printKnowledge;
	}

	public static boolean isPrintWorld() {
		return printWorld;
	}

	public static void setPrintWorld(boolean printWorld) {
		Main.printWorld = printWorld;
	}

	public static void quit() {
		System.exit(0);
	}

	public static TurnHandler getHandler() {
		return handler;
	}

	public static void setHandler(TurnHandler handler) {
		Main.handler = handler;
	}

	public static boolean isPrintAction() {
		return printAction;
	}

	public static void setPrintAction(boolean printAction) {
		Main.printAction = printAction;
	}

	public static int getWaitTime() {
		return waitTime;
	}

	public static void setWaitTime(int waitTime) {
		Main.waitTime = waitTime;
	}
}
